package isc.whu.defender;

import isc.whu.defender.firewall.FirewallMainActivity;
import isc.whu.defender.logger.Logger;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;

public class DefenderMainActivity extends Activity {
	private ImageButton btnFirewall;
	private ImageButton btnNetMonitor;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.home);

		// get widget object
		btnFirewall = (ImageButton) findViewById(R.id.image_btn_1);
		btnNetMonitor = (ImageButton) findViewById(R.id.image_btn_2);
		
		// set listener
		btnFirewall.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				Logger.write("DefenderMainActivity, start firewall button clicked.");
				Intent intent = new Intent(DefenderMainActivity.this, 
						FirewallMainActivity.class);
				startActivity(intent);
			}
		});
		
		btnNetMonitor.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				Logger.write("DefenderMainActivity, start traffic monitor button clicked.");
			
				Intent intent = new Intent(DefenderMainActivity.this, 
						isc.whu.defender.netmonitor.MonitorActivity.class);
				startActivity(intent);
				
			}
		});
		
		
	}

}